package com.sky.vo;

import com.ejlchina.searcher.bean.DbField;
import com.ejlchina.searcher.bean.SearchBean;
import com.sky.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;

/**
 * @Author tzl
 * @Date 2023-07-17 11:22:46  星期一
 * @Description: 菜品和套餐关联实体类
 */
@Data
@EqualsAndHashCode(callSuper = true)
@SearchBean(tables = " dish d left join setmeal_dish s on d.id = s.dish_id and s.del_flag = '0' ",
        where = "d.del_flag = '0'", autoMapTo = "d")
public class SetmealDishVo extends BaseEntity {

    @DbField("s.id")
    private Long id;

    //菜品名称
    @DbField("d.name")
    private String name;

    //菜品分类id
    @DbField("d.category_id")
    private Long categoryId;

    //菜品价格
    @DbField("d.price")
    private BigDecimal price;

    //图片
    @DbField("d.image")
    private String image;

    //描述信息
    @DbField("d.description")
    private String description;

    //0 停售 1 起售
    @DbField("d.status")
    private Integer status;

    //套餐id
    @DbField("s.setmeal_id")
    private Long setmealId;

    //菜品id
    @DbField("s.dish_id")
    private Long dishId;

    //菜品名称 （冗余字段）
    @DbField("s.name")
    private String setmealName;

    //菜品原价
    @DbField("s.price")
    private BigDecimal setmealPrice;

    //份数
    @DbField("s.copies")
    private Integer copies;

}
